/**
 * @Author Weton Li
 * @Date 2021/3/20 14:15
 */
import java.util.*;


public class Solution {
    /**
     * 30 91 4 70 801
     * 91 801 70 4 30
     * 最大数
     * @param nums int整型一维数组
     * @return string字符串
     */
    public String solve (int[] nums) {

        int currNum = 0;


        String[] strings = new String[nums.length];

        int num[] = new int[nums.length];
        String s = Arrays.toString(strings);
        // 遍历数组所有元素
        for (int i = 0; i < nums.length; i++) {
            currNum = nums[i];
            String s1 = String.valueOf(currNum);
            strings[i] = s1;
        }

        for (String string : strings) {
            System.out.print(string+"\t");
        }

        System.out.println();
        for (int i = 0; i < strings.length; i++) {
            char c = strings[i].charAt(0);
            System.out.print(c+"\t");
            // 将字符转为数字
            String s2 = Character.toString(c);
            Integer integer = Integer.valueOf(s2);
            System.out.println(integer);
            num[i] = integer; // 将数字存到数组中
        }

        Arrays.sort(num);
        System.out.println();
        for (int i : num) {
            System.out.println(i);
        }
        // 确定排序顺序 3 4 7 8 9。30 4 70

        // 取每个数的最高位 按最高位从小到大比较 排列

        // 合并


        return null;
    }

    public static void main(String[] args) {
        Solution solution = new Solution();
        int[] nums = {30,91,4,70,801};
        solution.solve(nums);
    }
}
